#pragma once

struct Student
{
	int grades[4];
};

class Builder
{
public:
	virtual ~Builder() {}
	virtual void BuilderStudent() = 0;
	virtual void BuildFirstYear(int g) = 0;
	virtual void BuildSecondYear(int g) = 0;
	virtual void BuildThirdYear(int g) = 0;
	virtual void BuildFourthYear(int g) = 0;
	virtual Student* GetStudent() = 0;
protected:
	Builder() {}
private:
};

class GradeBuilder : public Builder
{
public:
	GradeBuilder() {}
	~GradeBuilder() {}
	void BuilderStudent() { _student = new Student; } 
	void BuildFirstYear(int g) { _student->grades[0] = g; }
	void BuildSecondYear(int g) { _student->grades[1] = g; }
	void BuildThirdYear(int g) { _student->grades[2] = g; }
	void BuildFourthYear(int g) { _student->grades[3] = g; }
	Student* GetStudent() { return _student; }
protected:
private:
	Student* _student;
};